<template>
  	<div id="changeNickName">
  		<header>
  			<i @click="goBack()"></i>
  			<div>修改昵称</div>
  		</header>
  		<div class="border-8"></div>
  		<div class="newNick">
	  		<textarea type="text" placeholder="请输入新昵称" v-model="userobj.username"></textarea>
  		</div>
  		<a class="sureBtn" @click="changeNickName()">
			确定
		</a>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				nickname: '',
                userobj: {
                    id: "",
                    username: "",
                }
			}
		},
		components: {

		},
		methods: {
			goBack() {
				this.$router.back();
			},
            changeNickName() {
                this.userobj.id = localStorage.getItem("loginMobile");
                console.log(this.userobj);
                this.$api.post(this.$api.baseURLSchool,"updatedata/user/edit",this.userobj,r => {
                    if(r.data.ret) {
                        this.$router.back();
                    }
                },err => {
                    console.log(err);
                })

            },
		},
		created() {

		}
	}
</script>
<style lang="scss" scoped>

</style>
